<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp" %>
<!-- 如何new一个对象 -->
<jsp:useBean id="dynastyPOJO" class="com.carlinfo.demo.pojo.ADynasty"/>
<!DOCTYPE HTML>
<html>
	<head>
		<title>添加资讯 - 用户中心</title>
		<%@ include file="/common/include/title.jsp" %>
		<%-- 百度编辑器 --%>
		<script type="text/javascript"
			src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
		<script type="text/javascript"
			src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
		<script type="text/javascript"
			src="${rootPath }/common/resource/H-ui.admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
		<meta name="keywords"
			content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
		<meta name="description"
			content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
	</head>
	<body>
		<article class="page-container">
			<!-- 把JSON当成Map -->
			${requestScope.resultJSON }---${requestScope.resultJSON.info}
			
			<form class="form form-horizontal" id="form-article-add"
				method="post" action="${rootPath }/back/DemoBackServlet?method=dynastyInsertSubmit">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>名字：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder=""
							id="articletitle" name="name">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>首都：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder=""
							id="articletitle" name="capital">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>年龄：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder=""
							id="articletitle" name="age">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>开国时间：</label>
					<div class="formControls col-xs-8 col-sm-9">
					<!-- my97date Picker
						http://www.my97.net/demo/index.htm
						文档是中文的,是中国人写的
						~引入:<script type="text/javascript" src="${rootPath }/common/resource/H-ui.admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
						参见:onclick
					 -->
						<input type="text" class="input-text Wdate" value="" placeholder=""
							id="articletitle" name="st" readonly="readonly"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>发布时间：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text Wdate" value="" placeholder=""
							id="articletitle" name="pubTime" readonly="readonly"
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span
						class="c-red">*</span>状态：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<!-- <label for="status0">
							<input type="radio" value="1" placeholder="" checked="checked"
								id="status0" name="status">启用
						</label>
						<label for="status1">
							<input type="radio" value="0" placeholder=""
								id="status1" name="status">禁用
						</label> -->
						<c:forEach items="${dynastyPOJO.statusMap}" var="me" varStatus="stat">
							<label for="status${me.value.value }">
								<input type="radio" value="${me.value.value }" placeholder=""
									${stat.first ? 'checked' : '' }
									id="status${me.value.value }" name="status">${me.value.info}
							</label>
						</c:forEach>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">内容：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<textarea name="context" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="$.Huitextarealength(this,200)"></textarea>
						<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">内容(先忽略)：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<script id="editor" type="text/plain" style="width: 100%; height: 400px;"></script>
					</div>
				</div>
				<div class="row cl">
					<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
						<button onClick="article_save_submit();"
							class="btn btn-primary radius" type="submit">
							<i class="Hui-iconfont">&#xe632;</i> 保存并提交审核
						</button>
						<button onClick="removeIframe();" class="btn btn-default radius"
							type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
					</div>
				</div>
			</form>
		</article>
	
		<!--/_footer /作为公共模版分离出去-->
		<script type="text/javascript">
		$(function(){
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});
		
			//表单验证
			$("#form-article-add").validate({
				rules:{
					articletitle:
					{
						required:true,
					},
					articletitle2:
					{
						required:true,
					},
					articlecolumn:
					{
						required:true,
					},
					articletype:
					{
						required:true,
					},
					articlesort:
					{
						required:true,
					},
					keywords:
					{
						required:true,
					},
					abstract:
					{
						required:true,
					},
					author:
					{
						required:true,
					},
					sources:
					{
						required:true,
					},
					allowcomments:
					{
						required:true,
					},
					commentdatemin:
					{
						required:true,
					},
					commentdatemax:
					{
						required:true,
					},
		
				},
				onkeyup:false,
				focusCleanup:true,
				success:"valid",
				submitHandler:function(form){
					//$(form).ajaxSubmit();
					var index = parent.layer.getFrameIndex(window.name);
					//parent.$('.btn-refresh').click();
					parent.layer.close(index);
				}
			});
		
			var ue = UE.getEditor('editor');
		});
	</script>
		<!--/请在上方写此页面业务相关的脚本-->
	</body>
</html>